//
//  MSJumpConn.m
//  MSJD
//
//  Created by xiangbo on 2018/12/10.
//  Copyright © 2018 xiangbo. All rights reserved.
//

#import "MSJumpConn.h"
#import "MSDetailViewController.h"
#import "MSAllListViewController.h"
#import "MSAddCommentsViewController.h"
#import "MSHomeFilterViewController.h"

@implementation MSJumpConn

+ (void)jumpControllerWithObject:(id)item{
    NSNumber *jumpKind = nil;
    if ([item isKindOfClass:MSFoodContentModel.class]) {
        jumpKind = ((MSFoodContentModel *)item).jumpKind;
    }
    switch (jumpKind.integerValue) {
        case 1:
        case 2:
            [self jumpToMSDetailViewController:item];
            break;
//        case 3:
//            [self jumpToAlllistViewController:item];
            break;
        default:
            break;
    }
}

+ (void)jumpToMSDetailViewController:(id)item{
    MSDetailViewController *detailVC = [MSDetailViewController loadDetailViewController:item];
    detailVC.hidesBottomBarWhenPushed = YES;
    UIViewController *currentVC = [UIViewController currentViewController];
    [currentVC.navigationController pushViewController:detailVC animated:YES];
}

+ (void)jumpToAlllistViewController:(id)item{
    MSAllListViewController *allListVC = [MSAllListViewController loadAllListViewControllerWithFoodData:item];
    allListVC.hidesBottomBarWhenPushed = YES;
    UIViewController *currentVC = [UIViewController currentViewController];
    [currentVC.navigationController pushViewController:allListVC animated:YES];
}

+ (void)jumpToPunishCommentViewController:(id)item{
    MSAddCommentsViewController *viewController = [MSAddCommentsViewController new];
    viewController.dataSource.data = item;
    viewController.hidesBottomBarWhenPushed = YES;
    [[UIViewController currentViewController].navigationController pushViewController:viewController animated:YES];
}

+ (void)jumpToHomeFilterViewController:(NSInteger)kindId
                         searchContent:(NSString *)searchContent
                          isFromSearch:(BOOL)isFromSearch {
    MSHomeFilterViewController *homeFilterVC = [MSHomeFilterViewController loadHomeFilterViewControllerWithKind:kindId IsfromSearchVC:isFromSearch searchContent:searchContent filterInfo:nil];
    homeFilterVC.hidesBottomBarWhenPushed = YES;
    [[UIViewController currentViewController].navigationController pushViewController:homeFilterVC animated:YES];
}

@end
